<template>
  <div class="tabs">
    <div class="tab-2">
      <label for="tab2-1">一</label>
      <input id="tab2-1" name="tabs-two" type="radio" checked="checked">
      <div>
        <h4>第一个标签页</h4>
        <p></p>
      </div>
    </div>
    <div class="tab-2">
      <label for="tab2-2">二</label>
      <input id="tab2-2" name="tabs-two" type="radio">
      <div>
        <h4>第二个标签页</h4>
        <p></p>
      </div>
    </div>
    <div class="tab-2">
      <label for="tab2-3">二</label>
      <input id="tab2-3" name="tabs-two" type="radio">
      <div>
        <h4>第三个标签页</h4>
        <p></p>
      </div>
    </div>
    <div class="tab-2">
      <label for="tab2-4">二</label>
      <input id="tab2-4" name="tabs-two" type="radio">
      <div>
        <h4>第四个标签页</h4>
        <p></p>
      </div>
    </div>
  </div>
</template>

<script>
    export default {
        name: "tabs"
    }
</script>
<style scoped>
  .tabs {
    display: block;
    display: -webkit-flex;
    display: -moz-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    -moz-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0;
    overflow: hidden; }
  .tabs [class^="tab"] label,
  .tabs [class*=" tab"] label {
    /*     color: black; */
    cursor: pointer;
    display: block;
    font-size: 16px;
    font-weight: 300;
    line-height:2;
    padding: 10px 0;
    text-align: center; }
  .tabs [class^="tab"] [type="radio"],
  .tabs [class*=" tab"] [type="radio"] {

    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out; }
  .tabs [class^="tab"] [type="radio"]:hover, .tabs [class^="tab"] [type="radio"]:focus,
  .tabs [class*=" tab"] [type="radio"]:hover,
  .tabs [class*=" tab"] [type="radio"]:focus {
    /*    tab标签选中的颜色标志      */
    border-bottom: 1px solid #40a9ff;
  }
  .tabs [class^="tab"] [type="radio"]:checked,
  .tabs [class*=" tab"] [type="radio"]:checked {
    border-bottom: 2px solid #40a9ff;
  }
  .tabs [class^="tab"] [type="radio"]:checked + div,
  .tabs [class*=" tab"] [type="radio"]:checked + div {
    opacity: 1; }
  .tabs [class^="tab"] [type="radio"] + div,
  .tabs [class*=" tab"] [type="radio"] + div {
    display: block;
    opacity: 0;
    padding: 23px 0;
    width: 90%;
    -webkit-transition: all 0.3s ease-in-out;
    -moz-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out; }
  .tabs .tab-2 {
    width: 50%; }
  .tabs .tab-2 [type="radio"] + div {
    width: 200%;
    margin-left: 200%; }
  .tabs .tab-2 [type="radio"]:checked + div {
    margin-left: 0; }
  .tabs .tab-2:last-child [type="radio"] + div {
    margin-left: 100%; }
  .tabs .tab-2:last-child [type="radio"]:checked + div {
    margin-left: -100%; }
</style>
